/**
 * 组织架构
 */
import request from '@/utils/request'

// 查询企业的部门列表
export const getDepartmentsAPI = () => {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

// 部门负责人列表
export const getEmployeeSimpleAPI = () => {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}

// 添加部门
export const addDepartmentsAPI = data => {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 编辑部门
export const updateDepartmentsAPI = data => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

// 部门详情
export const getDepartDetailAPI = id => {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

// 删除部门
export const delDepartmentAPI = id => {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

